package com.huawei.appmarket.service.distribution.batchdownload.bean;

import android.content.Context;
import com.huawei.appgallery.jsonkit.api.JsonBean;
import com.huawei.appmarket.service.distribution.authentication.bean.AgdSecurityVerificationRequest;
import com.huawei.appmarket.service.externalservice.distribution.download.request.DownloadInfo;
import java.util.List;
import o.cfv;
import o.cvs;
import o.Logger;
import o.CollectCheck;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class AgdBatchVerificationRequest extends cfv {
    public static final String APIMETHOD = "client.agdBatchSecurityVerification";
    private int advPlatform_;
    private int callWay_;
    private List<String> callerAppSigns_;
    private String callerPkgName_;
    private String uriParams_;

    static class UriParams extends JsonBean {
        String advInfo_;
        String downloadParams_;
        String pkgName_;
        String referrer_;

        private UriParams() {
        }
    }

    public AgdBatchVerificationRequest(String str, Context context) {
        super.setMethod_(APIMETHOD);
        this.callerPkgName_ = str;
        this.callerAppSigns_ = AgdSecurityVerificationRequest.ˎ(str, context);
    }

    public static String ॱ(List<DownloadInfo> list) {
        if (CollectCheck.isEmpty(list)) {
            return null;
        }
        JSONArray jSONArray = new JSONArray();
        for (DownloadInfo downloadInfo : list) {
            UriParams uriParams = new UriParams();
            uriParams.advInfo_ = downloadInfo.ˋ();
            uriParams.downloadParams_ = downloadInfo.ॱ();
            uriParams.referrer_ = downloadInfo.ˏ();
            uriParams.pkgName_ = downloadInfo.ˎ();
            try {
                jSONArray.put(new JSONObject(uriParams.toJson()));
            } catch (JSONException e) {
                Logger.e(cvs.TAG, "JSONException");
            } catch (IllegalAccessException e2) {
                Logger.e(cvs.TAG, "IllegalAccessException");
            }
        }
        return jSONArray.toString();
    }

    public void ॱˊ(String str) {
        this.uriParams_ = str;
    }

    public void ʻ(int i) {
        this.callWay_ = i;
    }

    public void ᐝ(int i) {
        this.advPlatform_ = i;
    }
}
